﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using MethodWorx.CMS.Membership;
using System.Data.Linq;

namespace MethodWorx.CMS.Linq
{
    [Table(Name="dbo.RolePermission")]
    public class LinqRolePermission: RolePermission
    {
        
        #region Proxy Property For Id
        [Column(IsPrimaryKey=true, UpdateCheck=UpdateCheck.Never)]
        public new Guid Id { get { return base.Id; } set { base.Id = value; } }
        #endregion
       
       
        #region Proxy Property For PluginId
        [Column(UpdateCheck=UpdateCheck.Never)]
        public new Guid? PluginId { get { return base.PluginId; } set { base.PluginId = value; } }
        #endregion
      
        
        #region Proxy Property For ObjectType
        [Column(UpdateCheck=UpdateCheck.Never)]
        public new string ObjectType { get { return base.ObjectType; } set { base.ObjectType = value; } }
        #endregion

        
        #region Proxy Property For ObjectId
        [Column(UpdateCheck=UpdateCheck.Never)]
        public new Guid? ObjectId { get { return base.ObjectId; } set { base.ObjectId = value; } }
        #endregion
      
      
        #region Proxy Property For Name
        [Column(UpdateCheck=UpdateCheck.Never)]
        public new string Name { get { return base.Name; } set { base.Name = value; } }
        #endregion
      
       
        #region Proxy Property For PermissionId
        [Column(UpdateCheck=UpdateCheck.Never)]
        public new Guid PermissionId { get { return base.PermissionId; } set { base.PermissionId = value; } }
        #endregion
      
        
        
        #region Proxy Property For Role
        private EntityRef<LinqRole> proxyRole = new EntityRef<LinqRole>();
        
        [Column(UpdateCheck=UpdateCheck.Never)]
        public Guid RoleId { get; set; }
        
        [Association(IsForeignKey=true, Name="Role", OtherKey="Id", ThisKey="RoleId", Storage="proxyRole")]
        public LinqRole ProxyRole
        {
          get { return this.proxyRole.Entity; }
          set { this.proxyRole.Entity = value; }
        }
        
        public override Role Role
        {
          get { return this.ProxyRole; }
          set { this.ProxyRole = (LinqRole)value; }
        }
        #endregion
      
    }
}
